#pragma once

#include <stdint.h>

#include <boost/asio.hpp>

using boost::asio::ip::tcp;

class client_base
{
	public:
		client_base( boost::asio::io_service &io );
		virtual ~client_base(void);

		virtual void handle_read( const boost::system::error_code &error, size_t bytes ) = 0;
		virtual void handle_write( const boost::system::error_code &error ) = 0;
		virtual void handle_close( const boost::system::error_code &error ) = 0;

		virtual uint32_t getBufLength() = 0;

		tcp::socket *getSocket() { return &socket; }
	protected:
		boost::asio::io_service &io_s;
		boost::asio::strand strand;
		tcp::socket socket;
};

